<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>产品单品管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
   
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/zTreeStyle/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/zTreeStyle/zTreeStyle.css" type="text/css">
     <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
     
    </style>
</head>

<body class="white-bg" style="color:#333;">
        <div class="page-heade">
       <h2 class="title_color text-center">产品单品回收站</h2>
    </div>
        <div class="col-md-12 mtp" style="padding:3px;">
			
				<table class="table" style="width: 100%;">
					<tbody>
						<tr>
							<td colspan="6">
								<input type="button" value="返回列表" class="btn btn-warning back"/> 
                               
	            				
							</td>
						</tr>
						<form action="#" method="post" id="form_check">
							 <input type="hidden" value='{$page}' name="page" id="page-go"/>
                			<input type="hidden" value='{$list}' name="list" id="list-go"/>
                	
						</form>
					</tbody>
				</table>
				{if condition="$sum neq 0"}
                <table class="table table-hover table-bordered text-center bud_hei table_striped" style="width: 100%;">
                    <thead>
                        <tr class='info'>
                            <td style="width:3%;">序号</td>
                            <td style="width:10%;">产品编号</td>
                            <td style="width:15%;">产品名称</td>
                            <td style="width:10%;">SKU</td>
                            <td style="width:10%;">产品系列</td>
                            <td style="width:10%;">产品品类</td>
                            <td style="width:10%;">产品品牌</td>
                            <td style="width:10%;">箱包装</td>
                            <td style="width:10%;">标准出厂价</td>
                           
                            <td style="width:12%;">操作</td>
                        </tr>
                        
                    </thead>
                    <tbody>
                        {volist name="parr" id="vo"}
                            <tr>
                                <td>{$i}</td>
                                <td>{$vo.pro_no}</td>
                                <td>{$vo.pro_name}</td>
                                <td>{$vo.sku_name}</td>
                                <td>{$vo.series_name}</td>
                                <td>{$vo.category_name}</td>
                                <td>{$vo.brand_name}</td>
                                <td>{$vo.box_num}{$vo.unit}</td>
                                <td>{$vo.factory}元/{$vo.unit}</td>
                                <td pid="{$vo.id}">
                                    
                                    <a href="javascript:;" class='huifup'>恢复</a>
                                </td>
                            </tr>
                        {/volist}
                        
                    </tbody>

                </table>
                <h5 class="text-center" style="font-weight: 500">
                    总共有{$sum}条记录，第{$page}/{$maxpage}页,当前页<input id="page" type="text"  style="width: 40px" value="{$page}"/><span id="gopage">Go</span>&nbsp;&nbsp;<span id="fistpage">首页</span>&nbsp;&nbsp;
                    每页显示
                    <select id="pagesize">
                        <option value='10' {if condition="$list eq 10"}selected{/if}>10条</option>
                        <option value='15'{if condition="$list eq 15"}selected{/if}>15条</option>
                        <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>

                    </select>
                </h5>
                {else/}
                <h3>对不起没有查询到符合条件的信息</h3>
                {/if}
            
        </div>
    </div>


    </div>
  
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
     <!-- Peity -->
    <script src="__STATIC__/layout/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- 自定义js -->
    <script src="__STATIC__/layout/js/content.js?v=1.0.0"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/zTreeStyle/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/zTreeStyle/jquery.ztree.excheck.js"></script>
    <!--统计代码，可删除-->
	<script>
 $(".huifup").click(function(){
             var pid=$(this).parent().attr("pid");
            swal({
                            title: "提示",
                            text: "您真的要恢复这个单品么？",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonColor: "#33FF33",
                            confirmButtonText: "是的我要恢复",
                            cancelButtonText: "取消",
                            closeOnConfirm: true
                        },
                        function (isConfirm) {
                            if (isConfirm) {
                           //alert(cid);
                            $.post("{:url('Products/huifup')}",{pid:pid},function(re){
                                //alert(re);
                                if(re==1){
                                    swal({
                                    title: "完成",
                                    text:  "单品已恢复",
                                    type: "success"
                                    },function(){
                                        location.href='{:url("Products/huishou")}';
                                    });
                                }else{
                                     swal({
                                    title: "错误",
                                    text:  "系统繁忙请稍后再试",
                                    type: "warning"
                                    });
                                }
                            })
                        }
                        })
                           
        })
         //翻页
        $("#pagesize").change(function(){
            $("#page-go").val(1);
            $("#list-go").val($(this).val());
            document.getElementById("form_check").submit();
        })
        $("#gopage").click(function(){
             $("#page-go").val($("#page").val());
              document.getElementById("form_check").submit();
        })
        $("#page").keyup(function(){

            if(isNaN(parseInt($(this).val()))){
                $(this).val(1);
            }else{
                $(this).val(parseInt($(this).val()));
            }
            
        })
        $("#fistpage").click(function(){
              $("#page-go").val(1);
              document.getElementById("form_check").submit();
        })
    
        $(".back").click(function(){
            location.href="{:url('Products/products')}";
        })

	</script>	
</body>

</html>
